from random import shuffle

from proxy_generator import ProxyGenerator
from cnproxy_generator import CnproxyGenerator
from cndashproxy_generator import CndashproxyGenerator
from freeproxylists_generator import FreeproxylistsGenerator
from proxyru_generator import ProxyruGenerator

class FinalProxyGenerator(ProxyGenerator):
  def __init__(self):
    super().__init__()
    # Add more proxy generators here.
    self._generators = [
        CnproxyGenerator(),
        CndashproxyGenerator(),
        FreeproxylistsGenerator(),
        ProxyruGenerator(),
        ]
    shuffle(self._generators)

  def GetProxyIterator(self):
    for g in self._generators:
      for proxy in g.GetProxyIterator():
        yield proxy
